package com.soar.recruitment.module.web.ui.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.text.TextUtils;

import com.soar.recruitment.R;
import com.soar.recruitment.common.ui.activity.SOARBaseActivity;
import com.soar.recruitment.common.ui.view.SystemBarHelper;
import com.soar.recruitment.module.web.ui.fragment.WebFragment;

/**
 * Created by chriswen on 2017/7/13.
 */

public class SoarWebActivity extends SOARBaseActivity {

    private String mUrl;

    @Override
    public int initLayout() {
        return R.layout.activity_main;
    }

    @Override
    public void initVariable() {
        Bundle bundle = getIntent().getExtras();
        mUrl = bundle.getString("url", "");
        if (TextUtils.isEmpty(mUrl)) {
            finish();
            return;
        }

        // Status bar
        SystemBarHelper.tintStatusBar(this, getResources().getColor(R.color.white));
        SystemBarHelper.setStatusBarDarkMode(this);
    }

    @Override
    public void initView(@Nullable Bundle savedInstanceState) {
        if (savedInstanceState == null) {
            loadRootFragment(R.id.fl_main_container, WebFragment.newInstance(mUrl));
        }
    }

    @Override
    public void initData() {

    }

    @Override
    protected boolean isShowToolBar() {
        return false;
    }
}